package com.day05.study.singleton_demo;

/**
 * 单例模式
 * <p>
 * 懒汉式
 */
public class Singleton02 {
    private static Singleton02 instance = null;

    private Singleton02() {

    }

    public static synchronized Singleton02 getInstance() {
        if (instance == null) {
            instance = new Singleton02();
        }
        return instance;
    }
}
